//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<IModel.h>
///	@path	~/src/graphics/
///	@date	2007/11/16
///	@desc	.

#pragma once

#include "xeres.h"

#include "object/IVar.h"

#include "graphics/IDevice.h"
#include "graphics/IGeometry.h"
#include "graphics/ITechnique.h"

namespace xeres {

	class RenderContext;
	class RenderPipeline;
	class RenderManager;

	/*!
		\class	IModel
		\brief	Encapsulates a model with attributes(shading, motion) & geometry.
		\details

		\par IModel Attributes:

			Basic attributes:

				'transform'		-	matrix<float>		-	for model transformation
				'color'			-	color4				-	model's default color
				'opacity'		-	float				-	model's transparency

			Shading attributes:

				'diffuse'		-	color4				-	diffuse attribute, usually alias of 'color'
				'specular'		-	color4				-	specular color
				'light'			-	array<ILight>		-	illumination list

			Animation attributes:

				'pose'			-	array<int>			-	mixing pose id array
				'mixing'		-	array<float>		-	mixing pose factor array

		\sa	IGeometry
	*/
	class IModel : public IObject
	{
	public:

		/// \name Constructor & Destructor
		//@{

		/// \ctor
		IModel( void );

		/// \dtor
		virtual ~IModel( void );

		//@}

		DECL_IOBJECT_INTERFACE( IModel , IObject );

	public:

		/// \name IModel Interface
		//@{
		
		/*!
			\brief		Connect an variable to an model attribute.
		*/
		virtual bool ConnectAttribute( const WString& name , RefWeak< IVar > var ) = 0;

		/*!
			\brief		Disconnect model attribute.
		*/
		virtual bool DisconnectAttribute( const WString& name ) = 0;

		/*!
			\brief		Disconnect all attributes.
		*/
		virtual void DisconnectAll( void ) = 0;

		/*!
			\brief		Process model batch.
		*/

		/*!
			\brief		Render model.
		*/
		virtual void Render( RenderContext& rc ) = 0;

		/*!
			\brief		Stream model to render batch.
		*/
		virtual void Batch( RenderManager& rm ) = 0;

		//@}
	};

} // namespace xeres
